package com.tensai.study.java.newconcept.typereactiveprogram.reactor.mono;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.netty.http.client.HttpClient;

import java.util.function.Function;

/**
 * @author Tensai
 */
@Slf4j
public class FromFuture {


    public static void main(String[] args) {

    }

    @Test
    public void testHttp(){
        Integer code = HttpClient.create()
                .post()
                .uri("https://baidu.com")
//                .send(Flux.just("bb1", "bb2", "bb3"))
                .responseSingle((res, content) -> Mono.just(res.status().code()))
                .map(it-> { log.info(it.toString()); return it;})
                .block();
    }
}
